function fun_tool(){
	var prjName="mgr_"
	return {
		setString: function(key,value){
			if(key == null || value == null){
				return;
			}
			localStorage.setItem(prjName+key,value)
		},
		getString: function(key){
			return localStorage.getItem(prjName+key)
		},
		getObject: function(key){
			var strValue = localStorage.getItem(prjName+key);
			if(strValue == null){
				return null;
			}
			return JSON.parse(strValue);
		},
		setObject: function(key,value){
			if(key == null || value == null){
				return;
			}
			localStorage.setItem(prjName+key,JSON.stringify(value))
		},
		setToken: function(token){
			this.setString("token",token);
		},
		getToken: function(){
			return this.getString("token");
		},
		setUserInfo: function (value){
			this.setObject("user_data",value);
		},
		getUserInfo: function (){
			return this.getObject("user_data");
		},
		getUrlParam: function (name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
            var r = window.location.search.substr(1).match(reg);  //匹配目标参数
            if (r != null) return unescape(r[2]); return null; //返回参数值
        },
        setAdminZoneIds: function (value){
        	this.setObject("admin_zoneIds",value);
        },
        getAdminZoneIds: function (){
        	return this.getObject("admin_zoneIds");
        },
        isAllZone: function (){
        	var zoneList = this.getObject("admin_zoneIds")
        	if(zoneList == null)
        		return false;
        	for (var i = 0; i < zoneList.length; ++i) {
        		if(zoneList[i] == -1){
        			return true
        		}
        	}
        	return false;
        }
	}
}
